package servers

import (
	"gorm.io/gorm"
	"server/model"
)

var Svc *ServiceContext

// ServiceContext 实例化所有的服务器
type ServiceContext struct {
	UserModel     model.UserDaoModel
	ResourceModel model.ResourceDaoModel
	DiamondModel  model.DiamondDaoModel
}

func NewServiceContext(sqlConn *gorm.DB) {
	Svc = &ServiceContext{
		UserModel:     model.NewDefaultUserDao(sqlConn),
		ResourceModel: model.NewDefaultResourceDao(sqlConn),
		DiamondModel:  model.NewDefaultDiamondDao(sqlConn),
	}
}
